package com.ms.game.invitefriend.db;

import java.util.Calendar;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import com.xpec.c4.db.model.basic.BasicModel;
import com.xpec.c4.game.time.TimeSys;

@Entity
@org.hibernate.annotations.Entity(dynamicInsert = true, dynamicUpdate = true)
@Table(name = "distributors")
@org.hibernate.annotations.Table(
		appliesTo = "distributors", indexes = 
		{
				@org.hibernate.annotations.Index(name = "IDX_GUID", columnNames = { "guid"})
				
		})
public class DistributorsModel extends BasicModel {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -587974204705572449L;

	public DistributorsModel() {
		eventTime = Calendar.getInstance();
		createTime = TimeSys.currentTimeMills();
	}
	
	private int id;
	
	/** 
	 * 紀錄時間
	 */
	private Calendar eventTime;
	
	/** 
	 * 遊戲時間
	 */
	private long createTime; 
	
	/**
	 * 玩家ID
	 */
	private String guid;
	
	/**
	 * 玩家暱稱
	 */
	private String playerName;
	
	/**
	 * 是否是有效的經銷商
	 * 預設true
	 */
	private boolean effective = true;

	/**
	 * 邀請碼數量
	 */
	private int inviteCodeCount;
	
	/**
	 * 升級到指定等級時可以拿到的錢
	 */
	private int designatedLeveMoney;
	
	/**
	 * 升級時可以拿到的錢
	 */
	private int levelUpMoney;

	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public Calendar getEventTime() {
		return eventTime;
	}

	public void setEventTime(Calendar eventTime) {
		this.eventTime = eventTime;
	}

	public long getCreateTime() {
		return createTime;
	}

	public void setCreateTime(long createTime) {
		this.createTime = createTime;
	}

	public String getGuid() {
		return guid;
	}

	public void setGuid(String guid) {
		this.guid = guid;
	}

	public String getPlayerName() {
		return playerName;
	}

	public void setPlayerName(String playerName) {
		this.playerName = playerName;
	}
	
	public boolean isEffective() {
		return effective;
	}

	public void setEffective(boolean effective) {
		this.effective = effective;
	}

	public void setInviteCodeCount(int inviteCodeCount) {
		this.inviteCodeCount = inviteCodeCount;
	}

	public Integer getInviteCodeCount() {
		return inviteCodeCount;
	}

	public void setInviteCodeCount(Integer inviteCodeCount) {
		this.inviteCodeCount = inviteCodeCount;
	}

	public int getDesignatedLeveMoney() {
		return designatedLeveMoney;
	}

	public void setDesignatedLeveMoney(int designatedLeveMoney) {
		this.designatedLeveMoney = designatedLeveMoney;
	}

	public int getLevelUpMoney() {
		return levelUpMoney;
	}

	public void setLevelUpMoney(int levelUpMoney) {
		this.levelUpMoney = levelUpMoney;
	}
}
